#include "gwbase/base/condvar.h"

namespace dicom {

CondVar::CondVar(Mutex* mutex): mutex_(mutex) { 
  pthread_cond_init(&cond_, NULL);
}

CondVar::~CondVar() {
  pthread_cond_destroy(&cond_);
}

void CondVar::Wait() {
  pthread_cond_wait(&cond_, &mutex_->mutex_);
}

void CondVar::Signal() {
  pthread_cond_signal(&cond_);
}

void CondVar::Broadcast() {
  pthread_cond_broadcast (&cond_);
}

}
